<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/18
 * Time: 17:35
 */

namespace app\admin\model;
use think\Model;
use think\Db;
class OrderModel extends Model{
    // 确定链接表名
    protected $table = 'snake_order';
    function getAll($map){
        return $this->where($map)->where("status=1")
            ->count();
    }

    function getOrder($map,$offset,$limit){
        return $this->where($map)->where("status=1")
            ->limit("$offset , $limit")
            ->order('addtime DESC,order_id DESC')
            ->select();
    }
}